home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
436_01
/
indemlib.mak
< prev
next >
Wrap
Text File
|
1994-10-07
|
5KB
|
170 lines
#==========================================================================
# INDEMLIB.MAK
#
# Creates INDEMO.EXE using INCONx.LIB.
#
# MAKE.EXE doesn't support redirection on ECHO, so this file calls
# INDEMRSP.BAT to create the response file, INDEMLIB.RSP, required
# by TLIB. If INDEMRSP.BAT is not available, you can recreate
# it from the following comments.
#
# ::INDEMRSP.BAT
# echo off
# set op=%path%
# path=%1
# for %%x in (INDEMLIB INDEMO) do if "%%x"=="%path%" goto :%%x
# path=%0
# echo %path%.BAT is meant to be called by INDEMLIB.MAK or INDEMO.MAK...
# goto :EXIT
# :INDEMLIB
# echo Creating %1.rsp ...
# echo -+incon & > %1.rsp
# echo -+inalpha & >> %1.rsp
# echo -+infloat & >> %1.rsp
# echo -+inintgr & >> %1.rsp
# echo -+intempl & >> %1.rsp
# echo -+inutil & >> %1.rsp
# echo -+stringz >> %1.rsp
# goto :EXIT
# :INDEMO
# for %%x in (s m c l S M C L) do if "%%x"=="%2" goto :OK
# echo Requires memory model (s, m, c, or l)
# goto :EXIT
# :OK
# echo Creating %1.rsp ...
# echo \tc\lib\c0%2+ > %1.rsp
# echo indemo%2 + >> %1.rsp
# echo inhelp%2 + >> %1.rsp
# echo incon%2 + >> %1.rsp
# echo inalpha%2 + >> %1.rsp
# echo infloat%2 + >> %1.rsp
# echo inintgr%2 + >> %1.rsp
# echo intempl%2 + >> %1.rsp
# echo inutil%2 + >> %1.rsp
# echo addattr + >> %1.rsp
# echo stringz >> %1.rsp
# :EXIT
# path=%op%
# set op=
#==========================================================================
#
# TCC options are:
# -c compile to OBJ
# -d merge duplicate strings
# -f- no floating point
# -G optimize for speed
# -I include directories
# -L library directories
# -mx memory model x
# -N check stack overflow
# -O jump optimization
# -o name object file
# -r use register variables
# -S compile to ASM
# -v source debugging on
# -w display all warnings
# -y line numbers in OBJ
# -Z register optimization
#
# TASM options are:
# /ml all symbols case sensitive
# /t suppress messages if assembly ok
# /w2 enable warning messages
# /z display source line w/error message
#
# TLINK options are:
# /c case significant
# /d warn duplicate symbols
# /m map file w/public symbols
# /v debugging info in .exe file
#==========================================================================
# If memory model not defined, use large.
!if !$d(MDL)
MDL=l
!endif
# Define paths for Turbo C and output directories. Make changes to these
# constants if your directory structure is set up differently.
TCC = \tc\tcc # path to TCC.EXE
TASM = \tasm\tasm # path to TASM.EXE
TLIB = \tc\tlib # path to TLIB.EXE
TLINK = \tc\tlink # path to TLINK.EXE
I_DIR = \tc\inc;\tc\inc\sys # include directory
L_DIR = \tc\lib\ # library directory
# Object and library modules required to make INDEMO.EXE.
STARTUP = $(L_DIR)c0$(MDL)
OBJS = $(STARTUP) indemo inhelp addattr
LIBS = incon$(MDL) $(L_DIR)emu $(L_DIR)math$(MDL) $(L_DIR)c$(MDL)
# Compiler, linker, assembler options.
!if $d(DEBUG)
C_OPTS = -c -d -f- -G -I$(I_DIR) -m$(MDL) -N -O -r -w -v -y -Z
L_OPTS = /c/d/m/v
!else
C_OPTS = -c -d -f- -G -I$(I_DIR) -m$(MDL) -O -r -w -Z
L_OPTS = /c/d/m
!endif
A_OPTS = /ml/t/w2/z
# Compile and link commands.
COMPILE = $(TCC) $(C_OPTS)
LINK = $(TLINK) $(L_OPTS)
# Common header files.
H_FILES = indecl.h indefs.h
# Object files for INCON.LIB.
INLIB = incon.obj inalpha.obj infloat.obj inintgr.obj intempl.obj \
inutil.obj stringz.obj
# Create INDEMO.EXE.
indemo.exe: indemo.obj inhelp.obj addattr.obj incon$(MDL).lib
$(LINK) $(OBJS), indemo, indemo, $(LIBS)
# Create INCON.LIB.
incon$(MDL).lib: $(INLIB)
indemrsp indemlib # call INDEMRSP.BAT
$(TLIB) incon$(MDL) @indemlib.rsp
del indemlib.rsp
# The compiler command lines below include a macro defined by
# Borland's MAKE.EXE that allows use of switches stored in
# environment variables. The macros below all reference an
# environment variable named X, defined by "set x=text_string".
indemo.obj: indemo.c $(H_FILES)
$(COMPILE) -f $(X) indemo # needs floating-point
inhelp.obj: inhelp.c addattr.h indefs.h
$(COMPILE) $(X) inhelp
incon.obj: incon.c incon.h $(H_FILES) instats.h stringz.h
$(COMPILE) $(X) incon
.c.obj:
$(COMPILE) $(X) $<
.asm.obj:
$(TASM) $(A_OPTS) $<;
inalpha.obj: $(H_FILES) incon.h
infloat.obj: $(H_FILES) incon.h
inintgr.obj: $(H_FILES) incon.h
intempl.obj: $(H_FILES) incon.h
inutil.obj : $(H_FILES)
addattr.obj: addattr.h
stringz.obj: stringz.h
#### EOF: INDEMLIB.MAK ####